package yf.mall.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import yf.mall.dao.BannerDao;
import yf.mall.entity.BannerEntity;
import yf.mall.enums.BannerTypeEnum;
import yf.mall.service.BannerService;
import com.yf.service.impl.BaseServiceImpl;

import java.util.List;

/**
 * 广告图Service实现类
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Tue Aug 13 15:06:03 CST 2019
 */
@Service
public class BannerServiceImpl extends BaseServiceImpl<BannerEntity> implements BannerService {

    private BannerDao bannerDao;


    @Autowired
    public void setDao(BannerDao bannerDao) {
        this.bannerDao = bannerDao;
        super.setBaseDao(bannerDao);
    }




    /**内部方法**/


    /**外部方法实现**/
    @Override
    public List<BannerEntity> findTopAct() {
        return bannerDao.findTopAct(BannerTypeEnum.TOPLEFT.getIndex(),BannerTypeEnum.TOPBOTTOMONE.getIndex(), BannerTypeEnum.TOPBOTTOMTWO.getIndex(), BannerTypeEnum.TOPCENTER.getIndex());
    }

    @Override
    public List<BannerEntity> findByType(Integer type) {
        return bannerDao.findByTop(type);
    }
}
